package com.design_pattern._03_behavioral._03_iterator;

import java.util.Collection;
import java.util.LinkedList;

public class Iterator {
    public static void main(String[] args) {
        Collection<String> collection = new LinkedList<>();
        LinkedList<String> list = new LinkedList<>();
        collection.add("a");
        collection.add("b");
        collection.add("c");
        list.get(2); // LinkedList查找效率很低，get方法，先判断下标位于前半段，还是后半段，然后从前或者从后查找，平均耗费时间为1/4总长度，时间复杂度为O(n)
    }
}
